<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员用户</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f4f4f4;
            color: #333;
            margin: 0;
            padding: 20px;
        }
        .admin-containe {
            max-width: 1000px;
            margin: auto;
            background: #fff;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        h1 {
            text-align: center;
        }
        .nav-links {
            padding: 0;
            list-style: none;
            text-align: center;
        }
        .nav-links li {
            display: inline;
            margin-right: 20px;
        }
        .nav-links a {
            text-decoration: none;
            color: #007bff;
            font-weight: bold;
        }
        .nav-links a:hover {
            text-decoration: underline;
        }
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f4f4f4;
            color: #333;
            margin: 0;
            padding: 20px;
        }
        .admin-container {
            max-width: 1000px;
            margin: auto;
            background: #fff;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        table, th, td {
            border: 1px solid #ddd;
        }
        th, td {
            text-align: left;
            padding: 8px;
        }
        th {
            background-color: #f2f2f2;
        }
        tr:nth-child(even) {
            background-color: #f9f9f9;
        }
        .action-buttons {
            text-align: center;
        }
        .action-button {
            padding: 8px 15px;
            background-color: #007bff;
            color: white;
            border: none;
            cursor: pointer;
            border-radius: 5px;
            transition: background-color 0.3s ease;
            margin-right: 5px;
        }
        .action-button:hover {
            background-color: #0056b3;
        }
        .delete-button {
            background-color: #dc3545;
        }
        .delete-button:hover {
            background-color: #c82333;
        }
    </style>
</head>
<body>
    <div class="admin-containe">
        <h1>管理控制台</h1>
        <ul class="nav-links">
            <li><a href="/dom/html/index.php">首页</a></li>
            <li><a href="/dom/admin_html/admin2.php">文章管理</a></li>
            <li><a href="/dom/html/hostadmin2.php">管理员管理</a></li>
            <li><a href="/dom/html/hostadmin.php">用户管理</a></li>
            <li><a href="/dom/admin_html/adminxg.php">修改密码</a></li>
            <li><a href="/dom/html/shangc.php">文件上传</a></li>
        </ul>
    </div>

    <div class="admin-container">
        <h2>管理员管理</h2>
        <table>
            <tr>
                <th>ID</th>
                <th>用户名</th>
                <th>编号</th>
            </tr>
            <?php
        include "/opt/lampp/htdocs/dom/html/db.php";
        $sql = "select * from admin";
        $db = new DB();
        $result_list = $db->select($sql);
        if(count($result_list)){
            foreach($result_list as $row){
                echo"
                <tr>
                    <td>".$row['id']."</td>
                    <td>".$row['user']."</td>
                    <td>".$row['name']."</td>
                    <td class='action-buttons'>
                        <button class='action-button'>编辑</button>
                        <button class='action-button delete-button'>删除</button>
                    </td>
                </tr>
                ";
            }
        }else{
                echo"
                <tr>暂无数据</tr>
                ";
        

        }

        ?>
        </table>
    </div>

</body>
</html>